package gewu.suleju.controller;


import gewu.suleju.model.pojo.User;
import gewu.suleju.model.vo.Result;
import gewu.suleju.sevice.imp.BrokerLandlordServiceImp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("brokerLandlord")
public class BrokerLandlordController {
    @Autowired
    BrokerLandlordServiceImp brokerLandlord;
    @ResponseBody
    @GetMapping("landlordIng")
    public Result landlordIng(String brokerid) {
        int brokerId=Integer.parseInt(brokerid);
        List<User> landlording=brokerLandlord.findUserLandlordIng(brokerId);
        return  new Result("200","查找服务中的房东成功",landlording);
    }
    @ResponseBody
    @GetMapping("landlordEnd")
    public Result landlordEnd(String brokerid) {
        int brokerId=Integer.parseInt(brokerid);
        List<User> landlordEnd=brokerLandlord.findUserLandlordEnd(brokerId);
        return  new Result("200","查找完成服务的房东成功",landlordEnd);
    }

}
